package com.sq.universe.system.feign;

import com.sq.universe.base.entity.RespEntity;
import com.sq.universe.system.entity.FileEntity;
import com.sq.universe.system.entity.UserEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.File;

@FeignClient(name = "universe-system-dev")
@RequestMapping("/system/file")
public interface FileFeign {

    /**
     * 系統生成的文件
     * @param file
     * @return
     */
    @PostMapping(value = "/uploadBySystem" , consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = MediaType.APPLICATION_STREAM_JSON_VALUE)
    public FileEntity uploadBySystem(@RequestPart("file") MultipartFile file, @RequestParam("fcId") Integer fcId) ;

    /**
     * 获取文件字节
     * @param fileId
     * @return
     */
    @RequestMapping("/getByte")
    public byte[] getByte( @RequestParam("fileId")Integer fileId);
}
